import PaymentOrder from './PaymentOrder'
import * as actions from '../../redux/actions/OrderAction'
import { SimpleType, StoreState } from '../../redux/Types'
import { Dispatch } from 'redux'
import { connect } from 'react-redux'


export function mapStateToProps({order: { data, loading } }: StoreState) {
  return {
    data,
    loading
  }
}
export function mapDispatchToProps(dispatch: Dispatch<actions.OrderAction>) {
  return {
    list: (data: SimpleType, page: any) => {
      dispatch(actions.page(page))
      dispatch(actions.getOrderList({
        ...data,
        appid: 'PAYMENTPAY'
      }))
    },
    recordId: (row: any) => {
      dispatch(actions.recordOrderId(row))
    }
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(PaymentOrder)